package cn.tedu.review;

import java.sql.SQLOutput;

/*本类用于复习构造函数*/
public class TestConstructor {
    public static void main(String[] args) {
        Student s = new Student();
        Student s1 = new Student("鬼魅森林");
        Student s2 = new Student("不闻不问",12,'男');
        System.out.println(s2.name);
        System.out.println(s2.gender);

        Ls l = new Ls();
    }
}
class Student{
    String name;//姓名
    int age;//年龄
    char gender;//性别

    public Student(){
        System.out.println("无参构造");
    }
    public Student(String s ){
        System.out.println("含参参数"+s);
    }

    public Student(String name, int age, char gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        System.out.println("全参参数"+name);
    }
}


class Ls extends Student{
    int score;//分数
    String sClass;//班级

    public Ls(){
        super("ueg");
        System.out.println("子类的无参构造");
    }
}